package main

import (
	_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
	_ "github.com/gogf/gf/contrib/nosql/redis/v2"
	"github.com/gogf/gf/v2/os/gctx"
	"github.com/gogf/gf/v2/os/gtime"
	"server/internal/library/snowflake"
	_ "server/internal/logic"
	_ "server/internal/packed"

	"server/internal/cmd"
)

func main() {
	// 设置基准时间
	if err := gtime.SetTimeZone("Asia/Shanghai"); err != nil {
		panic(err)
	}

	// 设置日志的默认处理器
	//glog.SetDefaultHandler(middleware.LoggingJsonHandler)

	// 初始化雪花节点
	snowflake.InitSerialNumberNode()

	cmd.Main.Run(gctx.GetInitCtx())
}
